<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="layuiadmin/layui/css/layui.css" media="all">
<script src="layuiadmin/layui/layui.js" charset="utf-8"></script>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
</head>
<body>
	<!-- 预定层 -->


	<form class="layui-form" action="">
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">入住时间</label>
				<div class="layui-input-inline">
					<input type="text" class="layui-input" id="orderstartdate"
						name="orderstartdate" placeholder="yyyy-MM-dd">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">退房时间</label>
				<div class="layui-input-inline">
					<input type="text" class="layui-input" id="orderenedate"
						name="orderenedate" placeholder="yyyy-MM-dd">
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-block">
				<button class="layui-btn" lay-submit="" lay-filter="booknow">下一步(选择房间)</button>
			</div>
		</div>
	</form>



	<script src="layuiadmin/layui/layui.js" charset="utf-8"></script>

	<script type="text/javascript">
		layui.use([ 'form', 'layer' ], function() {
			var form = layui.form, layer = layui.layer;
			//监听提交
			form.on('submit(booknow)', function(data) {
				var d = data.field;
				if(d.orderstartdate=="" || d.orderenedate==""){
					layer.alert("还有时间没选");
				}else if(Date.parse(d.orderenedate)-Date.parse(d.orderstartdate)<=0){
				layer.alert("退房时间选择不正确");
			}else{
				window.location.href="adminbooknow?orderstartdate="+d.orderstartdate+"&orderenedate="+d.orderenedate;
			}
				return false;
			});
		});
	</script>
	<script type="text/javascript">
		//限定时间，只能提前七天预定
		layui.use('laydate', function() {
			var laydate = layui.laydate;
			laydate.render({
				elem : '#orderstartdate',
				min : 0,
				max : 7
			});
			console.log($("#orderstartdate").html());
			laydate.render({
				elem : '#orderenedate',
				min : 0,
				max : 10
			});
		});
	</script>


</body>
</html>